package com.ruoyi.car.mapstruct;

import com.ruoyi.car.controller.admin.carinfo.vo.*;
import com.ruoyi.car.entity.CarInfo;
import com.ruoyi.car.entity.CarInfoPhoto;
import com.ruoyi.car.es.entity.EsCarInfo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @Author wy
 * @Description TODO
 * @Date 2023/6/12 16:12
 * @Version 1.0
 */
@Mapper
public interface CarInfoConvert {

    CarInfoConvert INSTANCE= Mappers.getMapper(CarInfoConvert.class);


    CarInfo  convert(CarInfoAddReq req);

    @Mapping(target = "picture",source = "url")
    CarInfoPhoto convert(CarInfoPhotoReq req);

    @Mapping(target = "url",source = "picture")
    CarInfoPhotoResp convert(CarInfoPhoto entity);


    CarInfo convert(CarInfoEditReq req);

    EsCarInfo convert(CarInfoResp resp);

    CarInfoResp convert(EsCarInfo es);
}
